<?php
// code to set include_path...

class AutoloadException extends Exception { }

/**
 * Autoloads needed classes
 * 
 * @author paq
 *
 */
class AutoloadClass {

    public static function autoload($sClassName) {

    	$path = '';
    	$dirs = explode("_", $sClassName);
    	foreach ($dirs as $dir) {
    		$path .= $dir . DIRECTORY_SEPARATOR;
    	}
    	
    	$path = substr($path, 0, -1) . '.php';
    	
        @include_once($path);
        //echo $path;

        // does the class requested actually exist now?
        return class_exists($sClassName);
            // yes, we're done
            //return;
         /*else {
        	throw new Exception('Class not found: ' . $sClassName);
        }*/
        
        return false;
    }
}

spl_autoload_register(array('AutoloadClass', 'autoload'));